#include <iostream>
#include <type_traits>

template <typename T, typename = std::enable_if_t<std::is_class_v<typename T::value_type>>>
void f()
{
    std::cout << "primary template\n";
}

template <typename T, typename = void>
void f(...)
{
    std::cout << "fallback\n";
}

struct WithValue {
    using value_type = int;
};
struct WithoutValue { };

int main()
{
    f<WithValue>(); // primary template
    f<WithoutValue>(); // fallback
}
